﻿<?xml version="1.0" encoding="utf-8"?>
<cms:formdefinition xmlns="http://www.composite.net/ns/management/bindingforms/std.ui.controls.lib/1.0" xmlns:internal="http://www.composite.net/ns/management/bindingforms/internal.ui.controls.lib/1.0" xmlns:f="http://www.composite.net/ns/management/bindingforms/std.function.lib/1.0" xmlns:cms="http://www.composite.net/ns/management/bindingforms/1.0">
  <cms:bindings>
    <cms:binding name="CurrentXslt" type="Composite.Data.Types.IXsltFunction, Composite"/>
    <cms:binding name="XslTemplate" type="System.String"/>
    <cms:binding name="Parameters" type="System.Collections.Generic.IEnumerable`1[[Composite.Functions.ManagedParameters.ManagedParameterDefinition, Composite]]"/>
    <cms:binding name="ParameterTypeOptions" type="System.Collections.Generic.IEnumerable`1[[System.Type]]"/>
    <cms:binding name="FunctionCalls" type="System.Collections.Generic.IEnumerable`1[[Composite.Functions.NamedFunctionCall, Composite]]"/>
    <cms:binding name="PreviewEventHandler" type="System.EventHandler" optional="false"/>
    <cms:binding name="PageId" type="System.Guid" optional="true"/>
    <cms:binding name="PageDataScopeName" type="System.String" optional="true"/>
    <cms:binding name="PageDataScopeList" type="System.Collections.IEnumerable" optional="true"/>
    <cms:binding name="ActiveCultureName" type="System.String" optional="true"/>
    <cms:binding name="ActiveCulturesList" type="System.Collections.IEnumerable" optional="true"/>

    <cms:binding name="SessionStateProvider" type="System.String" />
    <cms:binding name="SessionStateId" type="System.Guid" />
  </cms:bindings>
  <cms:layout iconhandle="xslt-based-function">
    <cms:layout.label>
      <cms:read source="CurrentXslt.Name"/>
    </cms:layout.label>
    <TabPanels PreSelectedIndex="3">
      <TabPanels.Label>
        <cms:read source="CurrentXslt.Name"/>
      </TabPanels.Label>
      <PlaceHolder Label="${Composite.Plugins.XsltBasedFunction, EditXsltFunction.LabelSettings}">
        <FieldGroup Label="${Composite.Plugins.XsltBasedFunction, EditXsltFunction.LabelSettings}">
          <TextBox Label="${Composite.Plugins.XsltBasedFunction, EditXsltFunction.LabelName}" Help="${Composite.Plugins.XsltBasedFunction, EditXsltFunction.HelpName}" Type="ProgrammingIdentifier">
            <TextBox.Text>
              <cms:bind source="CurrentXslt.Name"/>
            </TextBox.Text>
          </TextBox>
          <TextBox Label="${Composite.Plugins.XsltBasedFunction, EditXsltFunction.LabelNamespace}" Help="${Composite.Plugins.XsltBasedFunction, EditXsltFunction.HelpNamespace}" Type="ProgrammingNamespace">
            <TextBox.Text>
              <cms:bind source="CurrentXslt.Namespace"/>
            </TextBox.Text>
          </TextBox>
          <TextArea Label="${Composite.Plugins.XsltBasedFunction, EditXsltFunction.LabelDescription}" Help="${Composite.Plugins.XsltBasedFunction, EditXsltFunction.HelpDescription}">
            <TextArea.Text>
              <cms:bind source="CurrentXslt.Description"/>
            </TextArea.Text>
          </TextArea>
          <EnumSelector EnumType="Composite.Plugins.Functions.FunctionProviders.XsltBasedFunctionProvider.OutputXmlSubType" Label="${Composite.Plugins.XsltBasedFunction, EditXsltFunction.OutputType}">
            <EnumSelector.Selected>
              <cms:bind source="CurrentXslt.OutputXmlSubType"/>
            </EnumSelector.Selected>
          </EnumSelector>
        </FieldGroup>
        <FieldGroup Label="${Composite.Plugins.XsltBasedFunction, EditXsltFunction.LabelDebug}">
          <PageSelector Label="${Composite.Plugins.XsltBasedFunction, EditXsltFunction.LabelPage}" Help="${Composite.Plugins.XsltBasedFunction, EditXsltFunction.HelpPage}">
            <PageSelector.Selected>
              <cms:bind source="PageId"/>
            </PageSelector.Selected>
          </PageSelector>
          <KeySelector OptionsKeyField="Key" OptionsLabelField="Value" Label="${Composite.Plugins.XsltBasedFunction, EditXsltFunction.LabelPageDataScope}" Help="${Composite.Plugins.XsltBasedFunction, EditXsltFunction.HelpPageDataScope}">
            <KeySelector.Options>
              <cms:read source="PageDataScopeList"/>
            </KeySelector.Options>
            <KeySelector.Selected>
              <cms:bind source="PageDataScopeName"/>
            </KeySelector.Selected>
          </KeySelector>
          <f:NullCheck>
            <f:NullCheck.CheckValue>
              <cms:read source="ActiveCultureName"/>
            </f:NullCheck.CheckValue>
            <f:NullCheck.WhenNotNull>
              <KeySelector OptionsKeyField="Key" OptionsLabelField="Value" Label="${Composite.Plugins.XsltBasedFunction, EditXsltFunction.LabelActiveLocales}" Help="${Composite.Plugins.XsltBasedFunction, EditXsltFunction.HelpActiveLocales}">
                <KeySelector.Options>
                  <cms:read source="ActiveCulturesList"/>
                </KeySelector.Options>
                <KeySelector.Selected>
                  <cms:bind source="ActiveCultureName"/>
                </KeySelector.Selected>
              </KeySelector>
            </f:NullCheck.WhenNotNull>
          </f:NullCheck>
        </FieldGroup>
      </PlaceHolder>
      <internal:ParameterDesigner Label="${Composite.Plugins.XsltBasedFunction, EditXsltFunction.LabelInputParameters}">
        <internal:ParameterDesigner.SessionStateProvider>
          <cms:read source="SessionStateProvider"/>
        </internal:ParameterDesigner.SessionStateProvider>
        <internal:ParameterDesigner.SessionStateId>
          <cms:read source="SessionStateId"/>
        </internal:ParameterDesigner.SessionStateId>
      </internal:ParameterDesigner>
      <internal:FunctionCallsDesigner Label="${Composite.Plugins.XsltBasedFunction, EditXsltFunction.LabelFunctionCalls}">
        <internal:FunctionCallsDesigner.SessionStateProvider>
          <cms:read source="SessionStateProvider"/>
        </internal:FunctionCallsDesigner.SessionStateProvider>
        <internal:FunctionCallsDesigner.SessionStateId>
          <cms:read source="SessionStateId"/>
        </internal:FunctionCallsDesigner.SessionStateId>
      </internal:FunctionCallsDesigner>
      <XsltEditor Label="${Composite.Plugins.XsltBasedFunction, EditXsltFunction.LabelTemplate}">
        <cms:bind source="XslTemplate"/>
      </XsltEditor>
      <f:NullCheck>
        <f:NullCheck.CheckValue>
          <cms:read source="PreviewEventHandler"/>
        </f:NullCheck.CheckValue>
        <f:NullCheck.WhenNotNull>
          <internal:PreviewPanel Label="${Composite.Plugins.XsltBasedFunction, EditXsltFunction.LabelPreview}">
            <internal:PreviewPanel.ClickEventHandler>
              <cms:read source="PreviewEventHandler"/>
            </internal:PreviewPanel.ClickEventHandler>
          </internal:PreviewPanel>
        </f:NullCheck.WhenNotNull>
      </f:NullCheck>
    </TabPanels>
  </cms:layout>
</cms:formdefinition>